/* 
 * File:   ESResourceManager.h
 * Author: Semidán Acosta Betancor
 *
 * Created on 18 de septiembre de 2011, 9:12
 */

#ifndef ESRESOURCEMANAGER_H
#define	ESRESOURCEMANAGER_H

#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>

namespace ee
{

class ESResourceManager
{
public:
    static ESResourceManager* instance();
    
    sf::Texture* loadImage(const std::string& name);
    sf::SoundBuffer* loadSound(const std::string& name);
    sf::Font* loadFont(const std::string& font);
   
    sf::Texture* getImage(const std::string& name);
    sf::SoundBuffer* getSound(const std::string& name);
    sf::Font* getFont(const std::string& name);
    
    void setGraphicRootDir(const std::string& dir);
    void setAudioRootDir(const std::string& dir);
    void setFontRootDir(const std::string& dir);
    
    void clearResources();
    void clearGraphicsResources();
    void clearAudioResources();
    void clearFontResources();
    
private:
    ESResourceManager();
    ESResourceManager(const ESResourceManager& orig); //

    virtual ~ESResourceManager();

private:
    static ESResourceManager *resourceManager;
    
    std::string graphicRootDir;
    std::string audioRootDir;
    std::string fontRootDir;
    
    std::map<std::string, sf::Texture*> imagesResources;
    std::map<std::string, sf::SoundBuffer*> soundsResources;
    std::map<std::string, sf::Font*> fontsResources;
};

}
#endif	/* ESRESOURCEMANAGER_H */

